home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.eunet.fi!nullnet!ichaos!jlaiho
- From: jlaiho@ichaos.nullnet.fi (Juha Laiho)
- Subject: Re: Function pointers; example code
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- Organization: NullNet r.y.
- Message-ID: <Dn32E0.A62@ichaos.nullnet.fi>
- References: <DMwzBL.HDt@ichaos.nullnet.fi> <TANMOY.96Feb18112049@qcd.lanl.gov>
- Mime-Version: 1.0
- Date: Tue, 20 Feb 1996 16:41:59 GMT
-
- tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) said:
- >In article <DMwzBL.HDt@ichaos.nullnet.fi> jlaiho@ichaos.nullnet.fi
- >(Juha Laiho) writes:
- ><snip>
- > Here's a short program I wrote as an example of function pointers. I'd
- > appreciate _any_ comments about it.
- >
- ...
- > typedef void f(int); /* f is a type that is a function taking one int
- > * argument and returning an int
- > */
- >Pointless and incorrect comment!
-
- Incorrect - yes I had forgotten to change the comment while I changed the
- code. Pointless - IMHO no. I wrote this code as an example to use when
- someone asks me about function pointers and how to use them. I like to be
- able to just send compilable code with all the necessary explanations in the
- comments.
-
- > typedef f *ptf; /* ptf is a type that is a pointer to a function */
- >
- >ptf is a pointer to a specific kind of function.
-
- Yes, I should change this, it seems.
-
- > f a, b, c; /* Define three functions a, b and c; each is 'void f(int)' */
- ^^^^^^
- Also, someone sent me email telling that "declare" would be the correct term
- here.
-
- Thank You all for the answers!
- --
- Wolf a.k.a. Juha Laiho Espoo, Finland
- (GEEK CODE 3.0) GIT d- s+: a- C++ UH++++$ UL++++ P- L+++ E--- W+ N+++ !K w !O
- !M V PS(+) PE Y+ !PGP t- 5? X? R tv- b+ DI? D+ G e+ h!>--- r++ y+
- "...cancel my subscription to the resurrection!" (Jim Morrison)
-